In [1]:
!git clone https://github.com/ChristophKirst/ClearMap.git


Cloning into 'ClearMap'...
remote: Counting objects: 813, done.
remote: Total 813 (delta 0), reused 0 (delta 0), pack-reused 813
Receiving objects: 100% (813/813), 30.97 MiB | 36.44 MiB/s, done.
Resolving deltas: 100% (344/344), done.
Checking connectivity... done.

In [1]:
## Script used to download nii run on Docker
from ndreg import *
import matplotlib
import ndio.remote.neurodata as neurodata
import nibabel as nb
inToken = "Fear199"
nd = neurodata()
print(nd.get_metadata(inToken)['dataset']['voxelres'].keys())
inImg = imgDownload(inToken, resolution=5)
imgWrite(inImg, "./Fear199.nii")


[u'1', u'0', u'3', u'2', u'5', u'4']

In [2]:
import os
import numpy as np
from PIL import Image
import nibabel as nib
import scipy.misc

In [3]:
rawData = sitk.GetArrayFromImage(inImg)  ## convert to simpleITK image to normal numpy ndarray
print type(rawData)


<type 'numpy.ndarray'>

In [ ]:
plane = 0;
for plane in (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15):
    output = np.asarray(rawData[plane])
    ## Save as TIFF for Ilastik
    scipy.misc.toimage(output).save('clarity'+str(plane).zfill(4)+'.tif')

/ apt-get install spyder apt-get install python-opencv apt-get install cython apt-get install python-tifffile apt-get install python-h5py apt-get install python-natsort pip install scikit-image/

//Files located at '/root/ClearMap_ressources/25um\ Autofluo\ Reference/template_25.tif ' BaseDirectory = '/root/data' cFosFile = os.path.join(BaseDirectory, 'template25.tif'); AutofluoFile = os.path.join(BaseDirectory, 'template25.tif'); PathReg = '/root/data'; AtlasFile = os.path.join(PathReg, 'regions.csv'); AnnotationFile = os.path.join(PathReg, 'annotation_25_full.nrrd');

/usr/local/lib/python2.7/dist-packages/ClearMap-0.9.2-py2.7-linux-x86_64.egg/ClearMap/ /root/ClearMap/ClearMap/Scripts